//
//  ReadScrollCell.swift
//  WalkNovel
//
//  Created by Kevin on 2023/8/3.
//

import UIKit

class ReadScrollCell: UITableViewCell {
    
    lazy var readChapterView: ReadChapterView = {
        let view = ReadChapterView()
        return view
    }()

    var pageModel: ChapterPageModel? {
        didSet {
            readChapterView.scrollModel = pageModel
            setNeedsLayout()
        }
    }

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        selectionStyle = .none
        backgroundColor = .clear
        contentView.addSubview(readChapterView)
        readChapterView.snp.makeConstraints { make in
            make.edges.equalTo(0)
        }
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
